package com.mars.boss.common.quartz;

import java.io.Serializable;

import javax.persistence.Table;

import com.mars.common.utils.RandomUitl;
import com.mars.mybatis.common.BaseEntity;

@Table(name = "tb_scheduler_job")
public class SchedulerJob extends BaseEntity implements Serializable {
	
    /**
     * 作业ID
     */
    private String jobId;

    /**
     * 作业名称
     */
    private String jobName;

    /**
     * 作业分组名称
     */
    private String jobGroup;

    /**
     * cron表达式
     */
    private String cronExpression;

    /**
     * 作业状态，默认：0正常，1：禁用
     */
    private Integer status = 0;

    /**
     * 参数
     */
    private String params;

    /**
     * 备注信息
     */
    private String remarks;

    private static final long serialVersionUID = 1L;

    public SchedulerJob() {
	}
    
	public SchedulerJob(String cronExpression) {
		super();
		this.cronExpression = cronExpression;
	}

	public SchedulerJob(String jobId, String cronExpression) {
		super();
		this.jobId = jobId;
		this.cronExpression = cronExpression;
	}

	public SchedulerJob(String jobId, String jobGroup, String cronExpression) {
		super();
		this.jobId = jobId;
		this.jobGroup = jobGroup;
		this.cronExpression = cronExpression;
	}
	
	public SchedulerJob(String jobId, String jobName, String jobGroup,
			String cronExpression) {
		super();
		this.jobId = jobId;
		this.jobName = jobName;
		this.jobGroup = jobGroup;
		this.cronExpression = cronExpression;
	}

	public SchedulerJob(String jobId, String jobName, String jobGroup,
			String cronExpression, Integer status, String params, String remarks) {
		super();
		this.jobId = jobId;
		this.jobName = jobName;
		this.jobGroup = jobGroup;
		this.cronExpression = cronExpression;
		this.status = status;
		this.params = params;
		this.remarks = remarks;
	}

	public String getJobId() {
		if(this.jobId == null) {
			return RandomUitl.uuid() ;
		}
		return jobId;
	}

	public void setJobId(String jobId) {
		this.jobId = jobId;
	}

	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	public String getJobGroup() {
		return jobGroup;
	}

	public void setJobGroup(String jobGroup) {
		this.jobGroup = jobGroup;
	}

	public String getCronExpression() {
		return cronExpression;
	}

	public void setCronExpression(String cronExpression) {
		this.cronExpression = cronExpression;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public String toString() {
		return "SchedulerJob [jobId=" + jobId + ", jobName=" + jobName
				+ ", jobGroup=" + jobGroup + ", cronExpression="
				+ cronExpression + ", status=" + status + ", params=" + params
				+ ", remarks=" + remarks + "]";
	}
    
}